<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<html>
  <head>
     <style type="text/css">
         .financialbody{
           width:960px;
           font-family:微软雅黑, 宋体;
           margin-left:10px;
         }
         
         .financialCotent{
            width:100%;
            font-size:12px;
            font-weight:bold;
            color:#ddd;
         }
         
         .financialSingle{
            background-image: url('${pageContext.request.contextPath}/cts/images/finacalbg.png');
            margin:4px 0 4px 0;
            width:955px;
            height:72px;
            border:0px solid red;
         }
         
         .financialSingleTab{
           width:917px;
           height:70px;
           padding-top:14px;
           margin-left:20px;
           font-size:12px;
           color:gray;
         }
         .financialTotal{
           width:100%;
           border-bottom:1px solid gray;
         }
         
         .totalShow{
            width:100%;
            padding:0px;
            color:#B9C884;
            font-size:10px;
            font-weight: bold;
            margin:4px 0 4px 0;
         }
         
         
         .font1{
           font-size:16px;font-weight:bold;color:#686868;font-family:'宋体';
         }
         
         .fpageNum{
            background-image: url('${pageContext.request.contextPath}/cts/images/showPageNum.gif');
            font-size:12px;
            color:gray;
            width:28px;
            height:28px;
            line-height:28px;
            text-align:center;
            border:0px solid gray;
         }
         
         .fpagePrev{
           background-image: url('${pageContext.request.contextPath}/cts/images/prev.gif');
           cursor:pointer;
           width:28px;
           height:28px;
           line-height:28px;
           border:0px solid gray;
         }
         
         .fpageNext{
           background-image: url('${pageContext.request.contextPath}/cts/images/next.gif');
           cursor:pointer;
           width:28px;
           height:28px;
           line-height:28px;
           border:0px solid gray;
         }
         
         .financialbody table tr td{
            overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
         }
     </style>
  </head>
  
  <body>
    <form id="financialForm">
       <s:if test="#request.list.size <=0">
           <div style="text-align:center;color:#999797;width:964px;float:left;clear: both;margin-top:20px;">数据显示完毕或者查询无结果</div>
       </s:if>
       <s:else>
		    <div id="financialbody" class="financialbody">
		       <div id="financialCotent" class="financialCotent">
		          <s:iterator value="#request.list" status="sta">
		             <div id="fincialSingle_<s:property value="id"/>" class="financialSingle">
		                <table  cellpadding="0" cellspacing="0" border="0" class="financialSingleTab" style="text-align:left;">
		                   <tr>
		                     <td width="132px" class="font1">
		                       
		                       <s:if test="type == 0">
		                          <a target="_blank" style="text-decoration: none;" href="${pageContext.request.contextPath}/cts/receiveDetail?id=<s:property value="id"/>">收入</a>
		                       </s:if>
		                       <s:elseif test="type == 1">
		                         <a target="_blank" style="text-decoration: none;" href="${pageContext.request.contextPath}/cts/payDetail?id=<s:property value="id"/>">支出</a>      
		                       </s:elseif>
		                       <s:elseif test="type == 2">
		                        <a target="_blank" style="text-decoration: none;" href="${pageContext.request.contextPath}/cts/awardDetail?id=<s:property value="id"/>">奖励</a>   
		                       </s:elseif>
		                     </td>
		                     <td width="180px"  class="font1"><s:property value="employee.nickname"/></td>
		                     <td width="442px"  class="font1">
		                          <s:if test="type == 0">+</s:if><s:else>-</s:else>&nbsp;<s:property value="currency.type.trim()"/>&nbsp;<s:property value="money"/>
		                     </td>
		                     <td>
		                       <s:if test="type == 0">
		                               到帐日期： 
		                       </s:if>
		                       <s:else>
		                               支付日期：
		                       </s:else>
		                       <s:date name="createTime" format="yyyy/MM/dd"/>
		                     </td>
		                   </tr>
		                   <tr>
		                     <td>
		                        <s:property value="cardNum"/>
		                     </td>
		                     <td>
		                             银行手续费：<s:property value="currency.type.trim()"/>&nbsp;<s:property value="bankDeductionMoney"/>
		                     </td>
		                     <td>
		                        <s:if test="isSettle == 1">
		                                 汇兑损益： <s:property value="currency.type.trim()"/>&nbsp;<s:property value="exchangeMoney"/>
		                        </s:if>
		                        <s:else>
		                                 未结算： <s:property value="currency.type.trim()"/>&nbsp;<s:property value="notWrittenOffmoney"/>
		                        </s:else>
		                     </td>
		                     <td style="text-align: center;voice-family: top;"> 
		                        <s:if test="isSettle == 0">
		                           <img src="${pageContext.request.contextPath}/cts/images/paying.png"/>
		                        </s:if>
		                        <s:else>
		                           <img src="${pageContext.request.contextPath}/cts/images/payed.png"/>
		                        </s:else>
		                     </td>
		                   </tr>
		                </table>
		             </div>
		          </s:iterator>
		       </div>
		       <div id="financialTotal" class="financialTotal">
		           <table id="totalShow" class="totalShow">
		            <tr>
			            <td style="width:39%;text-align:right;"><span>合计：</span>
			              <span style="font-size:10px;">
				              <s:iterator value="#request.allTotallist1" var="val">
				                 <s:iterator value="#val">
				                    <s:if test="value != 0.0 || value != 0">
				                        +<s:property value="key"/><s:property value="value"/>&nbsp;
				                    </s:if>
				                 </s:iterator>
				              </s:iterator>
				              
				              <s:iterator value="#request.allTotallist2" var="val">
				                  <s:iterator value="#val">
				                    <s:if test="value != 0.0 || value != 0">
				                       -<s:property value="key"/><s:property value="value"/>&nbsp;
				                    </s:if>
				                  </s:iterator>
				              </s:iterator>
				              
				              <s:iterator value="#request.allTotallist3" var="val">
				                   <s:iterator value="#val">
				                      <s:if test="value != 0.0 || value != 0">
				                         -<s:property value="key"/><s:property value="value"/>&nbsp;
				                      </s:if>
				                   </s:iterator>
				              </s:iterator>
			              </span>
			              &nbsp;&nbsp;&nbsp;
			            </td>
			            <td style="width:20%;text-align:center;"><span>银行手续费：</span>
			               <span style="font-size:10px;">
				               <s:iterator value="#request.totalFee" var="val">
				                   <s:iterator value="#val">
				                    <s:if test="value != 0.0 || value != 0">
				                      <s:property value="key"/> <s:property value="value"/>&nbsp;
				                    </s:if>
				                   </s:iterator>
				               </s:iterator>
			               </span>
			            </td>
			            <td style="width:40%;text-align:left;">
			              &nbsp;&nbsp;&nbsp;
			              <span>汇兑损益：</span>
			              <span style="font-size:10px;">
				              <s:iterator value="#request.totalLoss" var="val">
				                   <s:iterator value="#val">
				                    <s:if test="value != 0.0 || value != 0">
					                    <s:property value="key"/> -<s:property value="value"/>&nbsp;
				                    </s:if>
				                  </s:iterator>
				               </s:iterator>
			               </span>
			            </td>
		            </tr>
		          </table>
		       </div>
		       <div id="financialPage">
		           <div style="display: none;">
			          <jsp:include flush="true" page="pageForm.jsp"></jsp:include>
			          <input type="hidden" id="urlforward"  value="" />
					  <div id="pagination" valign="middle" class="pagination" style="display:none;"></div>
		           </div>
		          <div style="float:right;">
		             <table style="margin-top:8px;">
		               <tr>
		                  <td>
		                     <div onclick="f_pagePrev()" class="fpagePrev" title="上一页"/> 
		                  </td>
		                  <td>
		                    <div id="f_page_num" class="fpageNum">1</div>
		                  </td>
		                  <td>
		                     <div onclick="f_pageNext()" class="fpageNext" title="下一页"/> 
		                  </td>
		               </tr>
		             </table>
		          </div>
		       </div>
		    </div>
       </s:else>
    </form>
   
  </body>
</html>

<script type="text/javascript">
	function getParam(istype) {
	    //$("#pageSize").val( $("#pageSize").text());
	    //var pageNumberS = $("#pageNumber").val();
	    //if(parseInt(pageNumberS) <= 0 || istype == 1){
	    //	pageNumberS = '1';
	    //}
	    //$("#pageNumber").val(pageNumberS);
	}		    
	
	paginationCommon(1);
</script>

<script type="text/javascript">
  $(function(){
     var pageNumber = '<s:property value="#request.list.size"/>';
     if(pageNumber == ''){
       pageNumberVal = '1';
     }
     
     $("#f_page_num").text(pageNumberVal);
     $("#pagination").hide();
  });
  
  
  function f_pagePrev(){
        pageNumberVal--;
        if(pageNumberVal > 0){
           $("#f_page_num").text(pageNumberVal);
           $("#pageNumber").val(pageNumberVal);
           searchResult();
        }else{
           pageNumberVal = 1;
           $("#f_page_num").text(1);
           $("#pageNumber").val(1);
        }
  }
     
  function f_pageNext(){
      var pageCount = '<s:property value="#request.pageCount"/>';
      pageNumberVal++;
      if(pageNumberVal <= pageCount ){
        $("#f_page_num").text(pageNumberVal);
        $("#pageNumber").val(pageNumberVal);
        searchResult();
      }else{
        pageNumberVal = pageCount;
        $("#f_page_num").text(pageCount);
        $("#pageNumber").val(pageCount);
      }
  }
  
</script>
